#include "EditView.h"


#include <qtoolbar.h>
#include <qlayout.h>

#include "NoteEdit.h"
#include "GlobalSetting.h"
#include "EditFactory.h"


EditView::EditView(QWidget* parent) : QWidget(parent)
{
	layout = new QHBoxLayout();
	layout->setContentsMargins(0, 5, 5, 5);
	setLayout(layout);
	

	
}


EditView::~EditView()
{
}



void EditView::createNote()
{
	
	if (layout->count() > 0)
	{
		
	}
	else
	{
		GlobalSetting* globalSetting = GlobalSetting::getInstance();
		NoteEdit::EditType editType = globalSetting->getDefaultEditType();

		EditFactory factory;
		noteEdit = factory.createEdit(editType);

		layout->addWidget(noteEdit);

		connect(this, SIGNAL(saveNote()), noteEdit, SLOT(saveNote()));
	}
	

}